/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Bean;

import Model.Business.Business;
import Model.Entity.Book;
import Model.Entity.ListData;
import java.util.ArrayList;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;

/**
 *
 * @author CUONGTROC
 */
@ManagedBean
@RequestScoped
public class ListBookBean {
    Book book = new Book();

    public Book getBook() {
        return book;
    }

    public void setBook(Book book) {
        this.book = book;
    }
    public String getBookID() {
        return BookID;
    }

    public void setBookID(String BookID) throws Exception {
        this.BookID = BookID;
        book = Business.getBookDetail(BookID);
    }
    private String BookID;
    /** Creates a new instance of ListBookBean */
    public ListBookBean() {
    }
    ArrayList<Book> listBook;

    public ArrayList<Book> getListBook() {
        return listBook;
    }

    public void setListBook(ArrayList<Book> listBook) {
        this.listBook = listBook;
    }
    public ArrayList<Book> getAllBook() throws Exception{
        listBook=Business.getAllBook();
        return listBook;
    }
}
